<?php

class bannerCycleWidgetComponents extends myComponents
{
  public function executeRender()
  {

  	$this->banners = Doctrine::getTable('Banner')->createQuery('b')
  		->select('b.*, bg.*')
  		->from('Banner b')
  		->innerJoin('b.BannerGroup bg')
  		->innerJoin('bg.StructureBannerGroups sbg')
  		->innerJoin('sbg.Structure s WITH s.id = ?', $this->getRoute()->getObject()->getId())
			->setHydrationMode(Doctrine::HYDRATE_ARRAY)
  		->limit(5)
			->execute();
			
			//echo '<pre>'; print_r($this->banners); exit;
  }
};